package com.cskaoyan.market.controller.wx;

import com.cskaoyan.market.db.domain.MarketBrand;
import com.cskaoyan.market.service.WxBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("wx/brand")
public class WxBrandController {
    @Autowired
    WxBrandService wxBrandService;

    @GetMapping("list")
    public Map<String, Object> list(MarketBrand marketBrand,
                                    @RequestParam(value = "page", defaultValue = "1") int page,
                                    @RequestParam(value = "limit", defaultValue = "10") int limit) {

        Map<String, Object> list = wxBrandService.list(marketBrand, page, limit);
        return list;
    }

    @GetMapping("detail")
    public Map<String, Object> listDetail(int id) {
        Map<String, Object> map = wxBrandService.detail(id);
        return map;
    }
}
